﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

	<SolidColorBrush x:Key="OuterBorder" Color="#ffe8a6"/>
	<SolidColorBrush x:Key="InnerBorder" Color="#ffe8a6"/>

	<Style TargetType="{x:Type ToolBarTray}">
		<Setter Property="Background"  Value="#9CAAC1"/>
	</Style>
	<Style TargetType="{x:Type ToolBar}">
		<Setter Property="Background"  Value="#BCC7D8"/>
	</Style>
	<Style TargetType="{x:Type StatusBar}">
		<Setter Property="Background" Value="#9CAAC1"/>
	</Style>
	
	<!-- TreeView -->
	<Style TargetType="{x:Type TreeView}">
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{StaticResource OuterBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Padding" Value="3"/>
		<Setter Property="Margin" Value="0"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TreeView}">
					<Border SnapsToDevicePixels="true" x:Name="Bd" BorderBrush="{StaticResource OuterBorder}" BorderThickness="1" Background="White" CornerRadius="4">
						<ScrollViewer Focusable="false" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Background="Transparent" Padding="{TemplateBinding Padding}" CanContentScroll="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
							<ItemsPresenter/>
						</ScrollViewer>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- Grid -->
	<ImageBrush x:Key="GridBackground"
		ImageSource="/Resources/background.bmp"
		Viewport="0,0,8,8"
		ViewportUnits="Absolute"
		TileMode="Tile" />
	
	<!-- Tab -->
	<SolidColorBrush x:Key="TabControlBackground" Color="White"/>

	<SolidColorBrush x:Key="OuterBorderDisabled" Color="#b8b8b8"/>
	<SolidColorBrush x:Key="InnerBorderDisabled" Color="#cfcfcf"/>
	<SolidColorBrush x:Key="TabControlDisabledBackground" Color="#b4b4b4"/>

	<Style TargetType="{x:Type TabControl}">
		<Setter Property="Foreground" Value="White"/>
		<Setter Property="Padding" Value="4,4,4,4"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Background" Value="#F9F9F9"/>
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabControl}">
					<Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
						<Grid.ColumnDefinitions>
							<ColumnDefinition x:Name="ColumnDefinition0"/>
							<ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition x:Name="RowDefinition0" Height="Auto"/>
							<RowDefinition x:Name="RowDefinition1" Height="*"/>
						</Grid.RowDefinitions>
						<TabPanel Margin="0,2,10,0" x:Name="HeaderPanel" Grid.Column="0" Grid.Row="0" IsItemsHost="true" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1"/>
						<Border x:Name="ContentPanel" Grid.Column="0" Grid.Row="1" BorderBrush="{StaticResource OuterBorder}" BorderThickness="1" CornerRadius="0,4,4,4">
							<Border x:Name="InnerBd" Background="{StaticResource TabControlBackground}" BorderBrush="{StaticResource InnerBorder}" BorderThickness="1" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local" CornerRadius="0,3,3,3">
								<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
							</Border>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="BorderBrush" TargetName="ContentPanel" Value="{StaticResource OuterBorderDisabled}"/>
							<Setter Property="BorderBrush" TargetName="InnerBd" Value="{StaticResource InnerBorderDisabled}"/>
							<Setter Property="Background" TargetName="InnerBd" Value="{StaticResource TabControlDisabledBackground}"/>
							<Setter Property="Foreground" Value="{StaticResource InnerBorderDisabled}"/>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Bottom">
							<Setter Property="Grid.Row" TargetName="HeaderPanel" Value="1"/>
							<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
							<Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
							<Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
							<Setter Property="Margin" TargetName="HeaderPanel" Value="2,0,2,2"/>
							<Setter Property="CornerRadius" TargetName="ContentPanel" Value="4,4,4,0"/>
							<Setter Property="CornerRadius" TargetName="InnerBd" Value="3,3,3,0"/>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Left">
							<Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0"/>
							<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
							<Setter Property="Grid.Column" TargetName="HeaderPanel" Value="0"/>
							<Setter Property="Grid.Column" TargetName="ContentPanel" Value="1"/>
							<Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
							<Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
							<Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
							<Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
							<Setter Property="Margin" TargetName="HeaderPanel" Value="0,2,2,2"/>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Right">
							<Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0"/>
							<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
							<Setter Property="Grid.Column" TargetName="HeaderPanel" Value="1"/>
							<Setter Property="Grid.Column" TargetName="ContentPanel" Value="0"/>
							<Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
							<Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
							<Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
							<Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
							<Setter Property="Margin" TargetName="HeaderPanel" Value="0,2,2,2"/>
							<Setter Property="CornerRadius" TargetName="ContentPanel" Value="4,0,4,4"/>
							<Setter Property="CornerRadius" TargetName="InnerBd" Value="3,0,3,3"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="TabItemFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3,3,3,1"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<SolidColorBrush x:Key="TabControlNormalBorderBrush" Color="#8C8E94"/>
	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#F3F3F3" Offset="0"/>
		<GradientStop Color="#EBEBEB" Offset="0.5"/>
		<GradientStop Color="#DDDDDD" Offset="0.5"/>
		<GradientStop Color="#CDCDCD" Offset="1"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="TabItemHotBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#e68e8c" Offset="0"/>
		<GradientStop Color="#c32a2a" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>

	<SolidColorBrush x:Key="TabItemSelectedBackground" Color="#F9F9F9"/>
	<SolidColorBrush x:Key="TabItemHotBorderBrush" Color="#3C7FB1"/>
	<SolidColorBrush x:Key="TabItemDisabledBorderBrush" Color="#FFC9C7BA"/>

	<LinearGradientBrush x:Key="TabItemBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#fffcf2" Offset="0"/>
		<GradientStop Color="#ffe8a6" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemHoverBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#fffcf2" Offset="0"/>
		<GradientStop Color="#ffe8a6" Offset="0.8"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemSideBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#e68e8c" Offset="0"/>
		<GradientStop Color="#c32a2a" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemSideBackgroundBottom" EndPoint="0,0" StartPoint="0,1">
		<GradientStop Color="#e68e8c" Offset="0"/>
		<GradientStop Color="#c32a2a" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemSideBorderBrush" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#e8a7a5" Offset="0"/>
		<GradientStop Color="#e8a7a5" Offset="0.7"/>
		<GradientStop Color="#323230" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemGlassBrush" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#96FFFFFF" Offset="0"/>
		<GradientStop Color="#28FFFFFF" Offset="0.5"/>
		<GradientStop Color="#00FFFFFF" Offset="0.5"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemDisabledBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#b4b4b4" Offset="1"/>
		<GradientStop Color="#dfdfdf" Offset="0"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemSideDisabledBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#f4f4f4" Offset="0"/>
		<GradientStop Color="#d7d7d7" Offset="0.7"/>
		<GradientStop Color="#c2c2c2" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="TabItemSideDisabledBorderBrush" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#f6f6f6" Offset="0"/>
		<GradientStop Color="#f6f6f6" Offset="0.7"/>
		<GradientStop Color="#c2c2c2" Offset="1"/>
	</LinearGradientBrush>

	<Style TargetType="{x:Type TabItem}">
		<Setter Property="Foreground" Value="White" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabItem}">
					<Grid>
						<Border 
							 Name="Border"
							 Background="Transparent"
							 BorderBrush="Transparent" BorderThickness="0,0,0,0" CornerRadius="2,2,0,0">
							<ContentPresenter x:Name="ContentSite"
							   VerticalAlignment="Center"
							   HorizontalAlignment="Center"
							   ContentSource="Header"
							   Margin="12,5,12,5"/>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True" />
								<Condition Property="IsEnabled" Value="True" />
							</MultiTrigger.Conditions>
							<MultiTrigger.Setters>
								<Setter TargetName="Border" Property="Background" Value="Gray" />
							</MultiTrigger.Setters>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="IsEnabled" Value="True" />
							</MultiTrigger.Conditions>
							<MultiTrigger.Setters>
								<Setter TargetName="Border" Property="Background" Value="{StaticResource TabItemBackground}" />
								<Setter Property="Foreground" Value="Black" />
							</MultiTrigger.Setters>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="IsEnabled" Value="False" />
							</MultiTrigger.Conditions>
							<MultiTrigger.Setters>
								<Setter TargetName="Border" Property="Background" Value="Gray" />
								<Setter Property="Foreground" Value="Black" />
							</MultiTrigger.Setters>
						</MultiTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Menu -->
	<LinearGradientBrush x:Key="MenuBackground" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#cad3e2" Offset="0"/>
		<GradientStop Color="#aeb9cd" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="MenuBackgroundHover" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Color="#fffbec" Offset="0"/>
		<GradientStop Color="#ffecb5" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="MenuSelected" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#c1cbda" Offset="0"/>
		<GradientStop Color="#e9ecee" Offset="1"/>
	</LinearGradientBrush>

	<SolidColorBrush x:Key="MenuBorder" Color="#bec3cb"/>
	<SolidColorBrush x:Key="MenuBorderHover" Color="#e5c365"/>
	<SolidColorBrush x:Key="MenuInnerBorder" Color="#65d12e27"/>
	<SolidColorBrush x:Key="MenuForeground" Color="Black"/>
	<SolidColorBrush x:Key="MenuItemBackground" Color="#e7eaed"/>
	<SolidColorBrush x:Key="MenuSelectedBorderHover" Color="#9ba7b7" />
	<SolidColorBrush x:Key="MenuSelectedInnerBorder" Color="#9ba7b7"/>

	<SolidColorBrush x:Key="MenuItemIconBackground" Color="#e8ebed"/>

	<Style TargetType="{x:Type Menu}">
		<Setter Property="Background" Value="{StaticResource MenuBackground}"/>
		<Setter Property="Foreground" Value="{StaticResource MenuForeground}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Menu}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{StaticResource MenuBorder}" BorderThickness="0,0,0,1" Padding="{TemplateBinding Padding}">
						<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
	<LinearGradientBrush x:Key="MenuItemSelectionFill" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#34C5EBFF" Offset="0"/>
		<GradientStop Color="#3481D8FF" Offset="1"/>
	</LinearGradientBrush>

	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Grid SnapsToDevicePixels="true">
			<Rectangle x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
			<Rectangle Margin="1" x:Name="InnerBorder" RadiusX="2" RadiusY="2"/>
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition MinWidth="24" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
					<ColumnDefinition Width="4"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="37"/>
					<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
					<ColumnDefinition Width="17"/>
				</Grid.ColumnDefinitions>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
				<Border Visibility="Hidden" Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Background="#E6EFF4" BorderBrush="#CDD3E6" BorderThickness="1" CornerRadius="3">
					<Path FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Fill="#0C12A1" Data="{StaticResource Checkmark}"/>
				</Border>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" Grid.Column="2" ContentSource="Header" RecognizesAccessKey="True"/>
				<TextBlock Margin="{TemplateBinding Padding}" Grid.Column="4" Text="{TemplateBinding InputGestureText}"/>
			</Grid>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuBackgroundHover}"/>
				<Setter Property="Stroke" TargetName="Bg" Value="{StaticResource MenuBorderHover}"/>
				<Setter Property="Stroke" TargetName="InnerBorder" Value="#FFFFFF"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="#FF9A9A9A"/>
				<Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9"/>
				<Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6"/>
				<Setter Property="Fill" TargetName="Glyph" Value="#848589"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}" TargetType="{x:Type ContentControl}">
		<Border Background="{StaticResource MenuItemBackground}" BorderBrush="{StaticResource MenuBorder}" BorderThickness="1">
			<Grid>
				<Rectangle HorizontalAlignment="Left" Margin="2" Width="28" Fill="{StaticResource MenuItemIconBackground}" RadiusX="2" RadiusY="2"/>
				<Rectangle HorizontalAlignment="Left" Margin="30,2,0,2" Width="1" Fill="Transparent"/>
				<Rectangle HorizontalAlignment="Left" Margin="31,2,0,2" Width="1" Fill="Transparent"/>
				<ContentPresenter Margin="1,0" Grid.ColumnSpan="2"/>
			</Grid>
		</Border>
	</ControlTemplate>
	<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
	<Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
		<Setter Property="ClickMode" Value="Hover"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<DockPanel SnapsToDevicePixels="true" Background="Transparent">
						<Rectangle x:Name="R1" Width="1" Fill="Transparent" DockPanel.Dock="Right"/>
						<Rectangle x:Name="B1" Height="1" Fill="Transparent" DockPanel.Dock="Bottom"/>
						<Rectangle x:Name="L1" Width="1" Fill="Transparent" DockPanel.Dock="Left"/>
						<Rectangle x:Name="T1" Height="1" Fill="Transparent" DockPanel.Dock="Top"/>
						<ContentPresenter HorizontalAlignment="Center" Margin="2,2,2,2" x:Name="ContentContainer" VerticalAlignment="Center"/>
					</DockPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Fill" TargetName="R1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
							<Setter Property="Fill" TargetName="B1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
							<Setter Property="Fill" TargetName="L1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
							<Setter Property="Fill" TargetName="T1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
							<Setter Property="Margin" TargetName="ContentContainer" Value="3,3,1,1"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
	<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
	
	<Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
		<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
		<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ScrollViewer}">
					<Grid SnapsToDevicePixels="true">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="*"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Border Grid.Column="0" Grid.Row="1">
							<ScrollContentPresenter Margin="{TemplateBinding Padding}"/>
						</Border>
						<RepeatButton Focusable="false" Style="{StaticResource MenuScrollButton}" Grid.Column="0" Grid.Row="0" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
							<RepeatButton.Visibility>
								<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
									<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
								</MultiBinding>
							</RepeatButton.Visibility>
							<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}"/>
						</RepeatButton>
						<RepeatButton Focusable="false" Style="{StaticResource MenuScrollButton}" Grid.Column="0" Grid.Row="2" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
							<RepeatButton.Visibility>
								<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
									<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
								</MultiBinding>
							</RepeatButton.Visibility>
							<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}"/>
						</RepeatButton>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<LinearGradientBrush x:Key="MenuItemPressedFill" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#28717070" Offset="0"/>
		<GradientStop Color="#50717070" Offset="0.75"/>
		<GradientStop Color="#90717070" Offset="1"/>
	</LinearGradientBrush>

	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Grid SnapsToDevicePixels="true">
			<Rectangle x:Name="OuterBorder" RadiusX="0" RadiusY="0"/>
			<Rectangle Margin="0" x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
			<Rectangle Margin="1" x:Name="InnerBorder"/>
			<DockPanel>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
				<Path Visibility="Collapsed" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="{StaticResource Checkmark}"/>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" ContentSource="Header" RecognizesAccessKey="True"/>
			</DockPanel>
			<Popup Focusable="false" AllowsTransparency="true" HorizontalOffset="1" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-1" x:Name="PART_Popup">
				<!--<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">-->
				<ContentControl IsTabStop="false" x:Name="SubMenuBorder" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}">
					<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
						<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
					</ScrollViewer>
				</ContentControl>
				<!--</Microsoft_Windows_Themes:SystemDropShadowChrome>-->
			</Popup>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsSuspendingPopupAnimation" Value="true">
				<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
			</Trigger>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<!--<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>-->
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Fill" TargetName="InnerBorder" Value="{StaticResource MenuBackgroundHover}"/>
				<Setter Property="Stroke" TargetName="InnerBorder" Value="{StaticResource MenuBorderHover}"/>
				<!--<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource MenuBorder}"/>-->
			</Trigger>
			<!--<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="Stroke" TargetName="Bg" Value="#E0717070"/>
					<Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuItemPressedFill}"/>
					<Setter Property="Stroke" TargetName="InnerBorder" Value="#50747272"/>
				</Trigger>-->
			<Trigger Property="IsSubmenuOpen" Value="true">
				<Setter Property="Fill" TargetName="OuterBorder" Value="{StaticResource MenuSelected}"/>
				<Setter Property="Fill" TargetName="InnerBorder" Value="Transparent"/>
				<Setter Property="Stroke" TargetName="InnerBorder" Value="{StaticResource MenuSelectedInnerBorder}"/>
				<Setter Property="Stroke" TargetName="OuterBorder" Value="Transparent"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="#FF9A9A9A"/>
				<Setter Property="Fill" TargetName="GlyphPanel" Value="#848589"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Grid SnapsToDevicePixels="true">
			<Rectangle x:Name="OuterBorder" RadiusX="2" RadiusY="2"/>
			<Rectangle Margin="1" x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
			<Rectangle Margin="2" x:Name="InnerBorder"/>
			<DockPanel>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
				<Path Visibility="Collapsed" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="{StaticResource Checkmark}"/>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" ContentSource="Header" RecognizesAccessKey="True"/>
			</DockPanel>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Stroke" TargetName="Bg" Value="#90717070"/>
				<Setter Property="Stroke" TargetName="OuterBorder" Value="#50FFFFFF"/>
				<Setter Property="Stroke" TargetName="InnerBorder" Value="#50FFFFFF"/>
			</Trigger>
			<Trigger Property="IsKeyboardFocused" Value="true">
				<Setter Property="Stroke" TargetName="Bg" Value="#E0717070"/>
				<Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuItemPressedFill}"/>
				<Setter Property="Stroke" TargetName="InnerBorder" Value="#50747272"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="#FF9A9A9A"/>
				<Setter Property="Fill" TargetName="GlyphPanel" Value="#848589"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>

	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Grid SnapsToDevicePixels="true">
			<Rectangle x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
			<Rectangle Margin="1" x:Name="InnerBorder" Stroke="Transparent" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition MinWidth="24" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
					<ColumnDefinition Width="4"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="37"/>
					<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
					<ColumnDefinition Width="17"/>
				</Grid.ColumnDefinitions>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
				<Border Visibility="Hidden" Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Background="#E6EFF4" BorderBrush="#CDD3E6" BorderThickness="1" CornerRadius="3">
					<Path FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Fill="#0C12A1" Data="{StaticResource Checkmark}"/>
				</Border>
				<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" Grid.Column="2" ContentSource="Header" RecognizesAccessKey="True"/>
				<TextBlock Visibility="Collapsed" Margin="{TemplateBinding Padding}" Grid.Column="4" Text="{TemplateBinding InputGestureText}"/>
				<Path Margin="4,0,0,0" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Grid.Column="5" Data="{StaticResource RightArrow}"/>
			</Grid>
			<Popup Focusable="false" AllowsTransparency="true" HorizontalOffset="-2" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3" x:Name="PART_Popup">

				<!--<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">-->
				<ContentControl IsTabStop="false" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}" x:Name="SubMenuBorder">
					<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
						<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
					</ScrollViewer>
				</ContentControl>
				<!--</Microsoft_Windows_Themes:SystemDropShadowChrome>-->
			</Popup>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsSuspendingPopupAnimation" Value="true">
				<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Stroke" TargetName="InnerBorder" Value="#D1DBF4FF"/>
			</Trigger>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<!--<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>-->
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuBackgroundHover}"/>
				<Setter Property="Stroke" TargetName="Bg" Value="{StaticResource MenuBorderHover}"/>
				<Setter Property="Stroke" TargetName="InnerBorder" Value="#FFFFFF"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="#FF9A9A9A"/>
				<Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9"/>
				<Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6"/>
				<Setter Property="Fill" TargetName="Glyph" Value="#848589"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<Style TargetType="{x:Type MenuItem}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
		<Style.Triggers>
			<Trigger Property="Role" Value="TopLevelHeader">
				<Setter Property="Padding" Value="7,3,8,3"/>
				<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			</Trigger>
			<Trigger Property="Role" Value="TopLevelItem">
				<Setter Property="Padding" Value="7,5,8,3"/>
				<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			</Trigger>
			<Trigger Property="Role" Value="SubmenuHeader">
				<Setter Property="Padding" Value="2,5,2,3"/>
				<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			</Trigger>
			<Trigger Property="Role" Value="SubmenuItem">
				<Setter Property="Padding" Value="2,5,2,3"/>
			</Trigger>
		</Style.Triggers>
	</Style>

	<!--<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
		<Setter Property="Height" Value="0"/>
		<Setter Property="Margin" Value="30,2,0,2"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Separator">
					<Border BorderBrush="{StaticResource MenuBorder}"
					  BorderThickness="0.5"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>-->
	
</ResourceDictionary>